﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Model;

namespace LaKuaShop_TestDemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    //声明一个事件委托类型
    public delegate void newdelegate(string str);
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            
            InitializeComponent();
        }


        //用户按钮
        private void User_Click(object sender, RoutedEventArgs e)
        {
            frame1.Source = new Uri("Page/UserPage.xaml", UriKind.Relative);
        }
        //打开购物车按钮
        public void ShopCart_Click(object sender, RoutedEventArgs e)
        {
            frame1.Source = new Uri("Page/ShopCartPage.xaml", UriKind.Relative);
        }
        //打开主页
        public void Home_ButtonClick(object sender, RoutedEventArgs e)
        {
            frame1.Source = new Uri("Page/ProductShowPage.xaml", UriKind.Relative);
        }
        //关闭页面
        private void Close_ButtonClick(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
        //打开收藏
        public void OpenCollection(object sender, RoutedEventArgs e)
        {
            frame1.Source = new Uri("Page/CollectPage.xaml", UriKind.Relative);
        }
        //退出按钮,直接退出程序
        private void GoBack_Click(object sender, RoutedEventArgs e)
        {
            Common.User = new UserInfo();
            this.Close();
        }
    }
}
